package com.md.drcs.dicom.dao;

import com.md.common.utils.dao.MyMapper;
import com.md.drcs.dicom.entity.StudyDownloadEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface StudyDownloadDao extends MyMapper<StudyDownloadEntity> {

    @Select("select * from u_study_download where `code` = #{code}")
    StudyDownloadEntity findByCode(String code);

    @Select("select * from u_study_download where `study_id` = #{studyId} limit 0, 1")
    StudyDownloadEntity findByStudyId(Integer studyId);

    @Update("update u_study_download set `status` = #{status} where id = #{id} ")
    void updateStatus(@Param("id") Integer id, @Param("status") Integer status);
}
